import { tableServiceInterface } from "@/common/interface/table.interface";
import {
  $musicSongBranchList,
  $musicSongBranchDelete,
  $musicSongBranchUpdate,
  $musicSongBranchAdd,
  $musicSongBranchDetail
} from "@/apis/music/songBranch/songBranch";
import {
  musicSongBranchListInterface,
  musicSongBranchAddInterface,
  musicSongBranchUpdateInterface
} from "@/apis/music/songBranch/songBranch.interface";
export default class MusicSongBranchService implements tableServiceInterface {
  async getTable(e: musicSongBranchListInterface): Promise<any> {
    return $musicSongBranchList(e);
  }
  deleteMultiple(e: Array<number>): Promise<any> {
    return $musicSongBranchDelete(e);
  }
  edit(e: musicSongBranchUpdateInterface): Promise<any> {
    return $musicSongBranchUpdate(e);
  }
  add(e: musicSongBranchAddInterface): Promise<any> {
    return $musicSongBranchAdd(e);
  }
  detail(id: number): Promise<any> {
    return $musicSongBranchDetail(id);
  }
  // 修改启用状态
  statusChange({ record, status }: { record: musicSongBranchUpdateInterface, status: number }) {
    record.status = status;
    return $musicSongBranchUpdate(record);
  }
  // 重传支体
  resubmit(record, { midFile, content, contentTwoFour }) {
    record.midFile = midFile;
    record.content = content;
    record.contentTwoFour = contentTwoFour;
    return $musicSongBranchUpdate(record);
  }
}